package com.lhy.framework.context.event;

import com.lhy.framework.beans.factory.BeanFactory;
import com.lhy.framework.context.ApplicationEvent;
import com.lhy.framework.context.ApplicationListener;

/**
 * @Title:
 * @Description: 功能概述:
 * @Author: lihaiyang
 * @version: 1.0 .
 * @Date: 2022-09-13 09:59
 * @Copyright: Copyright(c)2022 RedaFlight.comAll Rights Reserved
 */
public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster {

    public SimpleApplicationEventMulticaster(BeanFactory beanFactory) {
        setBeanFactory(beanFactory);
    }

    @Override
    public void multicastEvent(ApplicationEvent event) {
        for (ApplicationListener applicationListener : getApplicationListeners(event)) {
            applicationListener.onApplicationEvent(event);
        }
    }
}
